﻿@model KidChoreApp.Web.Models.AddKidToChoreVM

<h3>Assign kids to @Model.Chore.Name</h3>


<h2>Kids Not Assigned</h2>
<table class="table table-hover table-striped">
    <tr>
        <th>Kid</th>
        <th colspan="2">Grade</th>
    </tr>
    @foreach (var c in @Model.KidsUnassigned)
    {
        <tr onclick="location.href='/Chore/ChoreDetail/@c.Id'">
            <td>@c.Name</td>
            <td>@c.Grade</td>
            <td>
                <form method="post" action="/Chore/AddKidToChore">
                    <input type="hidden" name="choreId" value="@Model.Chore.Id" />
                    <input type="hidden" name="kidId" value="@c.Id" />
                    <input type="submit" value="+" class="btn btn-success btn-sm" />
                </form>
            </td>
        </tr>
    }
</table>

<h2>Kids Assigned</h2>
<table class="table table-hover table-striped">
    <tr>
        <th>Kide</th>
        <th colspan="2">Grade</th>
    </tr>
    @foreach (var c in @Model.KidsAssigned)
    {
        <tr onclick="location.href='/Chore/ChoreDetail/@c.Id'">
            <td>@c.Name</td>
            <td>@c.Grade</td>

        </tr>
    }
</table>
<a class="btn btn-success btn-block" href="/Chore/ChoreDetail/@Model.Chore.Id">Back to Details for @Model.Chore.Name</a>

